package edu.sctu.wulixia.month6.day20150606;

import edu.sctu.wulixia.month6.day20150606.Check.CheckCard;
import edu.sctu.wulixia.month6.day20150606.Check.SecurityCheck;
import edu.sctu.wulixia.month6.day20150606.Data.SetPeopleData;
import edu.sctu.wulixia.month6.day20150606.Data.Time;
import edu.sctu.wulixia.month6.day20150606.PeopleInfo.PeopleAppbean;

/**
 * Created by user05 on 2015/6/6.
 */
//乘客进入地铁站乘车 出站

public class PeopleGetIn {
    public void isPeopleGetIn() {

        PeopleAppbean people = new SetPeopleData().setPeopleData().get(1);
        Time time = new Time();
        if (people.isCard()) {
            if (new SecurityCheck(people,"小刀").checkBackPack() &&
                    new SecurityCheck(people,"汽油").checkWater()) {
                System.out.println("有违禁品，不能带入车内！！");
                System.out.println("_____________");
            }
                if (people.getPrice() > 2) {
                    System.out.println("请进站,祝您旅途愉快！！");
                } else {
                    new CheckCard().setPrice(10, people);
                    System.out.println("余额不足2元，不能进站！");
                    System.out.println("充值成功");
                }

                if (people.isThief()) {
                    System.out.println("乘客您好，偷盗属于违法行为,请留下调查！！");
                }else{
                    if (people.getPrice() >= new CheckCard().getPrice(
                            people.getStart(), people.getEnd())) {
                        System.out.println("出站,余额为:"
                                + (people.getPrice() - new CheckCard().getPrice(
                                people.getStart(), people.getEnd())));
                    } else {
                        new CheckCard().setPrice(10, people);
                        System.out.println("余额不足*******");
                        System.out.println("充值成功");
                        System.out.println("请出站,余额为:"
                                + (people.getPrice() - new CheckCard().getPrice(
                                people.getStart(), people.getEnd())));
                    }
                    System.out.println("乘车信息为：");
                    time.getTime();
                }

            } else {
                System.out.println("请买票");
                if (new SecurityCheck(people,"小刀").checkBackPack()&&
                        new SecurityCheck(people,"汽油").checkWater()) {
                    System.out.println("有违禁品");
                    System.out.println("_____________");
                }
                        if (people.isThief()) {
                            System.out.println("乘客您好，偷盗属于违法行为！！");

                    } else {
                            System.out.println("出站");
                        }
            System.out.println("乘车信息为：");
            time.getTime();
        }

    }
}